package com.usian.dao;

import com.usian.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmpMapper extends tk.mybatis.mapper.common.Mapper<Emp>{
@Select("select * from role where ename=#{ename} and pws=#{pws}")
    Role findByName(@Param("ename") String ename,@Param("pws") String pws);
@Select("select e.*,z.zname,d.`dname` from emp e,zhi z,dept d where e.`did`=d.id and e.`zid`=z.`id`")
    List<Dto> findAll();
@Select("select * from dept")
    List<Dept> findDept();
    @Select("select z.id,z.zname,d.`dname` from zhi z,dept d where z.`did`=d.`id`")
    List<Zd> findZhi();
    @Select("select * from emp where id=#{id}")
    Emp findById(Integer id);
    /*@Select("select e.*,z.zname,d.`dname` from emp e,zhi z,dept d where e.`did`=d.id and e.`zid`=z.`id`")
    List<Dto> findB();*/
}

